package com.hsd.app.action;


import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.hsd.app.service.IHealthReportService;
import com.hsd.core.page.entity.PageParams;
import com.hsd.core.page.entity.Pagination;
import com.hsd.core.utils.PageParam;
import com.hsd.core.utils.PageUtil;



@Controller
@RequestMapping("/report")
public class HealthReportAction {
	@Autowired
	private IHealthReportService healthReportService;
	 
	/**
	 * 我的养生报告
	 * @param request
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/loadReportList.do")
	public String loadReportList(PageParams pageParams,HttpServletRequest request,ModelMap model){ 
		String username = request.getParameter("username");
		String startdate = request.getParameter("startdate");
		String enddate = request.getParameter("enddate");
		Pagination page = healthReportService.loadReportList(pageParams,username,null,startdate,enddate);
		
		model.addAttribute("page",page);
		model.addAttribute("username",username);
		model.addAttribute("startdate",startdate);
		model.addAttribute("enddate",enddate);
		return "app/report/report-list"; 
	}

	public void setHealthReportService(IHealthReportService healthReportService) {
		this.healthReportService = healthReportService;
	}
	 
}
